<template>
  <div>
    <el-button size="mini" type="primary" :icon="isView ? 'el-icon-more' : 'el-icon-edit' " @click="to" />
    <eForm ref="form" :sup-this.sync="supThis" :is-add="false" :is-view="isView ? true : false" />
  </div>
</template>
<script>
import eForm from './form'
export default {
  components: { eForm },
  props: {
    isView: {
      type: Boolean,
      required: true
    },
    data: {
      type: Object,
      required: true
    },
    supThis: {
      type: Object,
      required: true
    }
  },
  methods: {
    to() {
      const _this = this.$refs.form
      _this.form = {
        id: this.data.id,
        username: this.data.username,
        phone: this.data.phone,
        account: this.data.account,
        password: this.data.password,
        cellphone: this.data.cellphone,
        customerId: this.data.customerId,
        customerName: this.data.customerName,
        creatTime: this.data.creatTime
      }
      _this.dialog = true
    }
  }
}
</script>

<style scoped>
  div{
    display: inline-block;
    margin-right: 3px;
  }
</style>
